package com.modelscope.ai.service;

import com.modelscope.ai.domain.entity.AiEntity;
import com.modelscope.ai.domain.vo.WeChatVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

@Service
@FeignClient(name = "wechat", url = "https://api.weixin.qq.com/")
public interface WeChatService {

//    @PostMapping(value = "/encoder", consumes = {MediaType.MULTIPART_FORM_DATA_VALUE})
//    String encoder(@RequestBody AiEntity aiEntity);

    @GetMapping("sns/jscode2session")
    String getOpenId(@RequestParam("appid") String appid,
                       @RequestParam("secret") String secret,
                       @RequestParam("js_code") String js_code,
                       @RequestParam("grant_type") String grant_type
    );

}
